package com.ihemou.gateway.config;

import cn.dev33.satoken.id.SaIdUtil;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.annotation.Scheduled;

/**
 * @author saperliu
 * @version 1.0.0
 * @date 2021-08-30 23:35
 * @Description 主动刷新Id-Token，保证其高可用
 */
@Configuration
public class SaIdTokenRefreshTask {
    // 从 0 分钟开始 每隔 5 分钟执行一次 Id-Token
    @Scheduled(cron = "0 0/5 * * * ? ")
    public void refreshToken(){
        SaIdUtil.refreshToken();
    }
}
